var regex = /(\.mp3|\.ogg)$/;
var anchors = document.getElementsByTagName("a");
var urls = [];

for (var i = 0; i < anchors.length; i++) {
    if (regex.test(anchors[i].href)) {
        urls.push({
            id: i,
            href: anchors[i].href,
            title: anchors[i].title ? anchors[i].title
                    : anchors[i].textContent
        });
    }
}

if (urls.length > 0) {
    chrome.extension.sendRequest({
        type: "load",
        urls: urls
    }, function(response) {

    });
}